<template>
    <div>
        <h1>操作数据模板子组件</h1>
        <input type="button" value=" - " @click="removeCount">
        <input type="text" v-model="$store.state.count" >
        <input type="button" value=" + " @click="addCount">
    </div>
</template>

<script>
export default {
    data() {
        return {};
    },
    methods: {
        removeCount() {
            this.$store.commit( "subtract" , { c: 3, d: 7 } );
        },
        addCount() {
            this.$store.commit( "increment" );
        }
    }
};
</script>

<style>

</style>
